<script setup lang="ts">
import { notice } from "@/serve/_";
import { NoticeType } from "@/types/response/home";
import { onMounted, reactive, toRefs } from "vue";
import { md5 } from "@/utils/md5";
import Headercomponents from "@/components/header.vue";

const state: {
  noticeArr: NoticeType[]
} = reactive({
  noticeArr: []
})

// let { noticeArr } = toRefs(state)

onMounted(() => {
  // getNotice()
  md5()
})

let getNotice = async () => {
  state.noticeArr = await notice();
  console.log(state.noticeArr);
} 
</script>

<template>
  <Headercomponents title="测试">
    <i>图标</i>
  </Headercomponents>
  <van-button type="primary" @click="getNotice">主要按钮</van-button>
  <div class="home">首页</div>
  <ul>
    <li v-for="item,index in state.noticeArr" :key="index">{{ item.notice_text }}</li>
  </ul>
</template>


<style lang="less" scoped>
@import "@page/Home.less";
</style>